<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="uct" uri="/WEB-INF/uct.tld" %>
<%@ taglib prefix="portal" uri="/WEB-INF/portal.tld" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<%@ include file="/common/sale/include/common-base.jsp"%>
  <title>配号查询</title>
</head>
<body class="hold-transition ${sysUserColor} sidebar-mini">
<div class="wrapper">
  <!-- top start -->
  <%@include file="/common/sale/top-user.jsp" %>
  <!-- top end -->
<!-- left start -->
  <%@include file="/common/sale/left-user.jsp" %>
<!-- left end-->
 <!-- main start -->
  <div class="content-wrapper">
	  <div class="content">
		  <div class="row">
			  <div class="col-lg-12 rightmt">
	           <div class="right_box">
	               <!-- 我的挂牌搜索 开始-->
			            <form id="searchFrom" class="form-horizontal">
			            <input type="hidden" name="pageName" value="trsNumbers-list"/>
						<input type="hidden" name="formName" value="searchForm">
				    	<!-- <input type="hidden" name="orderBy"  value="trsNumbers.pro_no" />  -->
				    	<input type="hidden" name="orderBy"  value="trsNumbers.create_time desc" />
				    	<input type="hidden" name="trsNumbers.w_userOwner" value="${loginUser.userEname}"/>
				    	
				    	
				         <!-- 我的挂牌搜索 start -->
						 <h4 class="user_title">
						   <p><i class="fa fa-search"></i><span>查询搜索</span></p>
						 </h4>
					     <!-- 我的挂牌搜索 end -->   
			            	<div class="form-group">
								<label  class="col-sm-3 control-label">
									商品代码：
								</label>
								<div class="col-sm-2">
									<input type="text" class="form-control"  name="trsNumbers.wl_proNo" id="proNo" value="" />
								</div>
								<label  class="col-sm-3 control-label">
									商品名称：
								</label>
								<div class="col-sm-2">
									<input type="text" class="form-control"  name="trsNumbers.wl_proName" id="proName" value="" />
								</div>
								
							</div>
			            <center>
				            <div class="box-footer clearfix">
				              <a href="javascript:void(0)" class="btn btn-danger " onclick="getTableData();">查询</a>
				              <a href="javascript:void(0)" class="btn btn-primary" onclick="FormUtil.cleanData('searchFrom');">重置</a>
				            </div>
			            </center>
			         </form>
			        </div>
			       <!-- 我的挂牌搜索 结束-->
			       
			       <div class="right_box" style="margin-top:20px;">
				         <!-- 我的挂牌搜索 start -->
								 <h4 class="user_title">
								   <p><i class="fa fa-line-chart"></i><span>配号结果列表</span></p>
								 </h4>
					    <!-- 我的挂牌搜索 end -->   
			            <table id="example" class="table table-hover user_table" >
			                <thead>
			                <tr>
			                  <th>序号</th>
			                  <th>商品代码</th>
			                  <th class="text_c">商品名称</th>
			                  <th>配号号码</th>
			                  <th>配号数量</th>
			                  <th>配号日期</th>
			                  <!--    <th>是否中签</th>
			                  <th>是否支付</th>
			                <th>操作</th>-->
			                </tr>
			                </thead>
			                <tbody id="myList">
			                </tbody>
			              </table>
		         	    <center>
		    	  			  <ul id="pageList"></ul>
		        		</center>
			        </div>
			     
			       <!-- 我的挂牌搜索 结束-->
	       
	        </div>
	       <!-- right end -->
	      </div>
	      </div>
	      </div>
	 <!-- mainrow end -->
</div>
 <!-- main end -->     
    
   <!-- foot start -->
 <%@include file="/common/sale/foot-user.jsp" %>
 <!-- foot start -->    
<div class="modal fade" id="my_modal_add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							×
						</button>
						<h4 class="modal-title">
							<font color="red">商品申购</font> 
						</h4>
					</div>
					<div class="modal-body">
						<div class="nav-tabs-custom">
					            <form class="form-horizontal" role="form" id="addForm1" action="javascript:void(0)">
									    <input type="hidden" id="addForm1_formToken" name="formToken" />
										<input type="hidden" name="doCode" value="dymicSql"/>
										<input type="hidden" name="pageName" value="bjtesale-number-list.jsp"/>
										<input type="hidden" name="formName" value="addForm1"/>
										
										
										<input type="hidden" name="trsNumbers.w_userId" value="${loginUser.userId}"/>
													
							                <!--trsSale start-->
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">商品代码</label>
												<div class="col-sm-8">
													<input name="trsNumbers.proNo" readonly="readonly" data-name="trsSale.proNo"  class="form-control clean"/>
												</div>
											</div>
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">商品名称</label>
												<div class="col-sm-8">
										  			<input name="trsNumbers.proName" readonly="readonly" data-name="trsSale.proName"  class="form-control clean"/>
												</div>
											</div>
											
						                	
											
											<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">申购数量</label>
												<div class="col-sm-8">
													<input type="text" id="trsNumbers_num" name="trsNumbers.num" class="form-control clean" maxLength="50" required placeholder="必填项" />
												</div>
											</div>
											
											
								        	<!--trsSale end-->
								        
					                    
					                    <div class="form-group">
								        	<div class="col-sm-12">
									         <div class="box-footer text-center">
									         	<button class="btn btn-danger" type="button" style="width: 200px;" onclick="submitForm1('addForm1');"> 提 交 </button>
					            			</div>
				            				</div>
				            			</div>
					                  </form>
					            <!-- tab content e -->
				          </div>	
					</div>
				</div>
				<!-- /.modal-content -->
			</div>		
</div>   

</body>
	<script type="text/template" id="dataList">
	  		<? for ( var i = 0; i < rows.length; i++) {?>
				<tr>
					<td class="text_c"><?=(pageObj.currentPage-1)*10+(i+1)?></td>
					<td class="text_c"><?=rows[i].proNo?></td>
					<td class="text_l"><?=strUtil.subStr(rows[i].proName,7)?></td>
					<td class="text_c"><?=rows[i].randNumber?></td>
					<td class="text_r"><?=strUtil.doNull(rows[i].nums,'-')?></td>
					<td class="text_c"><?=strUtil.doNull(rows[i].createTime,'')?></td>
					
					
				</tr>
     		<?}?>
	</script>
	<script type="text/template" id="rulespro-template">
		<? for ( var i = 0; i < rows.length; i++) {?>
		<div class="form-group col-sm-10">
			<label  class="col-sm-4 control-label"><?=rows[i].paramName?></label>
			<div class="col-sm-8">
				<input class="form-control fx12" value="<?=strUtil.doNull(rows[i].paramNo,'')?>"  readonly="readonly"/>
			</div>
		</div>
   <?}?>  		
</script>

<script>
var clickMenu= 'number-list';
var id;
var paramData = {};
$(function () {
	getTableData();
});

//清空数据
function cleanData(id){
	$('#'+id).find(".clean").val("");//按照样式清空；
}

function getTableData(){
	deleteAllRow('example');
	$.ajax({
		   type:'get',
		   url:common_list_url,
		   data:$('#searchFrom').serialize()+getCurrentPage(common_list_url+"?"+$('#searchFrom').serialize(),10),
		   dataType:'json',
		   success: function(myData){
			console.log(myData);
			var data = baidu.template('dataList',eval(myData));  
			$("#myList").html(data);
			  var option= {
					   ele:$("#pageList")[0],
					   total:myData.total,
					   fn:getTableData,
					   url:common_list_url+"?"+$('#searchFrom').serialize()
				   }
			generatePages(option);
		   }
		});	
  }

function deleteAllRow(tableId){
	var tb = document.getElementById(tableId);
	if(tb){
	     var rowNum=tb.rows.length;
	     for (var i=1;i<rowNum;i++){
	         tb.deleteRow(i);
	         rowNum=rowNum-1;
	         i=i-1;
	     }
     }
}

function setToken(){
	$.ajax({
	    type:'get',
	    url:'${ctx}/sendPage/token?token=true',
	    dataType:'text',
	    success: function(myData){
	    	paramData.formToken = myData;
	  	}
	});	
}

function cannel(modalId){
	$('#'+modalId).modal('hide');
}

function refresh(){
    //window.location.reload();
	getTableData();
}

//回车查询
document.onkeydown=function mykeyDown(e){  
      //compatible IE and firefox because there is not event in firefox  
       e = e||event;  
       if(e.keyCode == 13) {getTableData();}   
       return;  
};


</script>
</html>
